//
// Created by 郝正辉 on 2020/11/28.
//

#ifndef C_TEST_HEAP_H
#define C_TEST_HEAP_H
typedef struct {
    int size;

    int (*compare)(const void *key1, const void *key2);

    void (*destroy)(void *data);

    void **tree;
} Heap;

void heap_init(Heap *heap,
               int (*compare)(const void *key1, const void *key2),
               void (*destroy)(void *data));

void heap_destroy(Heap *heap);

int heap_insert(Heap *heap, const void *data);

int heap_extract(Heap *heap, void **data);

#define heap_size(heap) ((heap)->size)

#endif //C_TEST_HEAP_H
